import request from '@/utils/request';

const baseURL = '/energy/consumption/industry';

/**
 * 行业数据-行业能源消费统计
 * @param params {{timeType:string;time:string;}} 参数
 */
export const statistics = params =>
  request({
    baseURL: `${baseURL}/statistics`,
    method: 'GET',
    params
  });

/**
 * 行业数据-行业能源消费table表
 * @param params {string[]} 参数
 *  */
export const table = energyTypeList =>
  request({
    baseURL: `${baseURL}/table`,
    method: 'GET',
    params: { energyTypeList }
  });

/**
 * 行业数据-行业下公司-能源消费table表
 * @param params {{timeType:string;time:string;areaCode:string;}} 参数
 */
export const tableByCode = ({ areaCode, timeType, time }) =>
  request({
    baseURL: `${baseURL}/company/table/${areaCode}`,
    method: 'GET',
    params: { timeType, time }
  });
